﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace btnet.pages
{
    public partial class view_memory_log : CommonPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Bug_Util.get_setting("MemoryLogEnabled", "1") != "1")
            {
                Response.End();
            }

            Bug_Util.do_not_cache(Response);

            security = new Security();
            security.check_security(HttpContext.Current, Security.ANY_USER_OK);

            Response.ContentType = "text/plain";
            Response.AddHeader("content-disposition", "inline; filename=\"memory_log.txt\"");

            List<string> list = (List<string>)Application["log"];

            Response.Write(DateTime.Now.ToString("yyy-MM-dd HH:mm:ss:fff"));
            Response.Write("\n\n");


            if (list != null)
            {
                for (int i = 0; i < list.Count; i++)
                {
                    Response.Write(list[i]);
                    Response.Write("\n");
                }
            }
            else
            {
                Response.Write("list is null");
            }
        }
    }
}
